<script src="<?php echo $baseurl?>public/ckeditor/ckeditor.js"></script>
<script src="<?php echo $baseurl?>public/ckeditor/adapters/jquery.js"></script>

<div class="breadcrumbwidget">
	<ul class="skins">
        <li><a href="default" class="skin-color default"></a></li>
        <li><a href="orange" class="skin-color orange"></a></li>
        <li>&nbsp;</li>
        <li class="fixed"><a href="" class="skin-layout fixed"></a></li>
        <li class="wide"><a href="" class="skin-layout wide"></a></li>
    </ul><!--skins-->
	<ul class="breadcrumb">
        <li><a href="">Home</a> <span class="divider">/</span></li>
        <li class="active">FAQ</li>
    </ul>
</div><!--breadcrumbwidget-->
<div class="pagetitle">
	<h1>Chỉnh sửa câu hỏi</h1> <span></span>
</div><!--pagetitle-->

<div class="maincontent">
<?php if(validation_errors()): ?>
    <div class="alert alert-error" style="margin: 10px 10px 10px 40px;">
      <button data-dismiss="alert" class="close" type="button">×</button>
      <?php echo validation_errors(); ?>
    </div>
<?php endif;?>
	<div class="contentinner content-dashboard">
    
    <?php $attr = array('class' => 'stdform'); echo form_open('', $attr)?>
        <p>
        	<label>Câu hỏi</label>
            <span class="field"><input type="text" name="question" class="input-xlarge" placeholder="Nhập câu hỏi" value="<?php echo $data ? $data->question : '';?>"/></span>
        </p>
        <p>
        	<label>Trả lời</label>
            <span class="field"><textarea id="content_" name="answer" cols="80" rows="5" class="span5"><?php echo $data ? $data->answer : '';?></textarea></span>
        </p>
        <p>
            <label></label>
            <button class="btn btn-rounded" type="submit"> <i class="iconfa-ok"></i> &nbsp; Lưu</button>
        </p>
    </form>
    
    </div>
</div>

<script type="text/javascript">
        CKEDITOR.replace( 'content_', {  enterMode : CKEDITOR.ENTER_BR, shiftEnterMode : CKEDITOR.ENTER_BR } );
        CKEDITOR.on( 'instanceReady', function( ev )
        {
         ev.editor.dataProcessor.writer.setRules( 'br',
         {
            indent : false,
            breakBeforeOpen : false,
            breakAfterOpen : false,
            breakBeforeClose : false,
            breakAfterClose : false
  });
  });
</script>